package cn.iocoder.yudao.module.game.dal.mysql.gameList;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.game.dal.dataobject.gameList.GameListDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.game.controller.admin.gameList.vo.*;

/**
 * 游戏列表 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface GameListMapper extends BaseMapperX<GameListDO> {

    default PageResult<GameListDO> selectPage(GameListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GameListDO>()
                .likeIfPresent(GameListDO::getName, reqVO.getName())
                .eqIfPresent(GameListDO::getRecommend, reqVO.getRecommend())
                .betweenIfPresent(GameListDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(GameListDO::getGameType, reqVO.getGameType())
                .eqIfPresent(GameListDO::getGameManufacturer, reqVO.getGameManufacturer())
                .orderByDesc(GameListDO::getId));
    }

}